//
//  SellerOrderListHeader.m
//  SmartCoin
//
//  Created by apple on 2018/3/7.
//  Copyright © 2018年 Cynic. All rights reserved.
//

#import "SellerOrderListHeader.h"

@implementation SellerOrderListHeader
//@property (nonatomic ,retain)UILabel *dateLabel;
//@property (nonatomic ,retain)UILabel *desLabel;
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    self.backgroundColor = [UIColor clearColor];
    return self;
}

-(void)drawRect:(CGRect)rect{
    
    UIView *bgview = [[UIView alloc] initWithFrame:CGRectMake(0, 20, cx_wid, self.bounds.size.height - 20)];
    bgview.backgroundColor = [UIColor whiteColor];
    [self addSubview:bgview];
    
    UIView *layerView = [[UIView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height - 20.5, cx_wid , 0.5)];
    layerView.backgroundColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.2];
    [bgview addSubview:layerView];
    
    _dateLabel = [[UILabel alloc] init];
    _dateLabel.bounds = CGRectMake(0, 0, 40, 21);
    _dateLabel.center = CGPointMake(12 + 15, 22);
    [bgview addSubview:_dateLabel];
    
    _desLabel = [[UIButton alloc] init];
    _desLabel.bounds = CGRectMake(0, 0, 40, 21);
    _desLabel.center = CGPointMake(cx_wid - 12 - 15, 22);
    [bgview addSubview:_desLabel];
    
    _dateLabel.font = _desLabel.titleLabel.font = [UIFont systemFontOfSize:15];
    [_desLabel setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    _dateLabel.textColor = [UIColor blackColor];
//    _desLabel.text = @"对账";
    [_desLabel setTitle:@"对账" forState:UIControlStateNormal];
    [_desLabel cx_eventsBlockHandler:^{
        
    } forControlEvents:UIControlEventTouchUpInside];
    _dateLabel.text = @"今日";
}



@end
